<template>
	<view class="goods-list">
		<view class="goods-item" v-for="(item, index) in goods" :key="index" @click="goNavigator(item.goods_id)">
			<image :src="item.goods_small_logo" class="image"></image>
			<view class="goods-price">
				<text>￥{{item.goods_price}}</text>
				<text class="old-price">￥{{item.goods_price + 200}}</text>
			</view>
			<view class="goods-name">
				{{item.goods_name}}
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'GoodsList',
		props: ['goods'],
		methods: {
			goNavigator(id) {
				this.$emit('goGoodsDetail', id)
			}
		}
	}
</script>

<style lang="scss">
	.goods-list {
		display: flex;
		flex-wrap: wrap;
		padding: 0 15rpx;
		justify-content: space-between;
		.goods-item {
			background-color: #fff;
			width: 355rpx;
			margin: 10rpx 0;
			padding: 15rpx;
			box-sizing: border-box;
			.image {
				display: block;
				margin: 0 auto;
				width: 80%;
				height: 300rpx;			
			}
			.goods-price {
				color: $shop-color;
				font-size: 35rpx;
				.old-price {
					color: #ccc;
					font-size: 25rpx;
					margin-left: 10rpx;
					text-decoration: line-through;
				}
			}
			.goods-name {
				font-size: 30rpx;
				line-height: 50rpx;
				padding: 15rpx 0 10rpx;
			}
		}
	}
	
</style>
